<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<div id="app">
    <div>{{msg}}</div>
    <my-component></my-component>
</div>


</body>
<script src="../../vender/vue@2.4.2.js"></script>
<script>
    Vue.component('myComponent',{
        template:'<button @click="updateMessage">{{message}}</button>',
        data: function () {
            return {
                message:'没有更新'
            }
        },
        methods:{
            updateMessage: function () {
                console.log('updateMessage');
                this.message='更新完成';
                console.log(this.$el.textContent);
                this.$nextTick(()=>{
                    console.log(this.$el.textContent);
                });
            }
        }
    });

    var app=new Vue({
        el:'#app',
        data:{
            msg:'Hello'
        }
    });



</script>
</html>